home *** CD-ROM | disk | FTP | other *** search
/ Softdisk for Windows 42 / Softdisk for Windows 42.iso / QUARRY / QUARRY.EXE / QUARRY.dxr / 00233_GETCODE.ls < prev    next >
Encoding:
Text File  |  1998-01-01  |  1.2 KB  |  46 lines

  1. on GETCODE
  2.   global REGNAME, ALPH, ALP, LALP, SS, SN, REGNAME1
  3.   set REGNAME to EMPTY
  4.   set ALP to the key
  5.   set ALPH to "ABCDEFGHIJKLMNOPQURSTUVWXYZabcdefghijklmnopqurstuvwxyz" & RETURN
  6.   if charToNum(ALP) = 8 then
  7.     set the text of field "REGNAMETEXT" to " "
  8.     dontPassEvent()
  9.     updateStage()
  10.     exit
  11.   end if
  12.   if ((ALPH contains ALP) = 0) and (the key <> " ") and (the key <> RETURN) then
  13.     dontPassEvent()
  14.   end if
  15.   if ((ALPH contains ALP) = 0) and (the key <> " ") and (the key <> RETURN) then
  16.     exit
  17.   end if
  18.   if the key = RETURN then
  19.     dontPassEvent()
  20.     set LSLP to 0
  21.     set REGNAME to the text of field "REGNAMETEXT"
  22.     set LSLP to length(REGNAME)
  23.     if LSLP < 5 then
  24.       beep()
  25.     end if
  26.     if LSLP < 5 then
  27.       put " " into field "REGNAMETEXT"
  28.     end if
  29.     updateStage()
  30.     if LSLP < 5 then
  31.       exit
  32.     end if
  33.     set REGNAME to the text of field "REGNAMETEXT"
  34.     set the keyDownScript to "GETCODE1"
  35.     set REGNAME1 to EMPTY
  36.     repeat with N = 1 to length(REGNAME)
  37.       set SS to char N of REGNAME
  38.       set SN to charToNum(SS)
  39.       set SN to SN + 48
  40.       set SS to numToChar(SN)
  41.       set REGNAME1 to REGNAME1 & SS
  42.     end repeat
  43.     go("CODE1")
  44.   end if
  45. end
  46.